import base64

def audio_to_base64(file_path):
    with open(file_path, "rb") as audio_file:
        audio_data = audio_file.read()
        base64_encoded = base64.b64encode(audio_data).decode("utf-8")
    return base64_encoded

# 使用示例
base64_string = audio_to_base64("新录音 1.m4a")  # 替换为你的音频文件路径
print(base64_string)  # 打印前100个字符避免刷屏
